//
//  DCell.m
//  ZhiBoYuan
//
//  Created by mac on 2018/4/13.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "DCell.h"

@implementation DCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
//     [self initUI];
}

-(void)setModel:(Home *)model
{
    _model = model;
//    _labelA.text  = model.nickName;
//    _labelC.text  = model.content;
//    _labelD.text  = model.msg;
    _ImageA.image = [UIImage imageNamed:@"qqqq"];
    
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initUI];
    }
    return self;
}

-(void)initUI
{
    
    _ImageA = [UIImageView new];
    [self.contentView addSubview:_ImageA];
    
    _labelA = [UILabel new];
    [self.contentView addSubview:_labelA];

    _labelC= [UILabel new];
    [self.contentView addSubview:_labelC];
    
    _labelD= [UILabel new];
    [self.contentView addSubview:_labelD];
    
    
    _ImageA.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 10)
    .heightIs(50)
    .widthIs(50);
    
    _labelA.sd_layout
    .leftSpaceToView(_ImageA, 10)
    .centerYEqualToView(_ImageA)
    .rightSpaceToView(self.contentView, 10)
    .autoHeightRatio(0);
    
    _labelC.sd_layout
    .topSpaceToView(_ImageA, 10)
    .leftSpaceToView(self.contentView,10)
    .rightSpaceToView(self.contentView, 10)
    .autoHeightRatio(0);
    
    _labelD.sd_layout
    .topSpaceToView(_labelC, 10)
    .rightSpaceToView(self.contentView, 10)
    .widthIs(100)
    .autoHeightRatio(0);

    [self setupAutoHeightWithBottomView:_labelC bottomMargin:10];

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
